package com.poizon.api;

import com.poizon.dto.LikeCommentDto;
import com.poizon.dto.LikeMomentDto;
import com.poizon.entity.Likes;
import com.poizon.service.intf.LikeService;
import com.poizon.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName LikesController
 * @Author NoCheng
 * @Date 2022/1/6 9:11
 * @Description:TODO 点赞相关
 */

@RestController
@CrossOrigin
@RequestMapping("/api/likes/")
@Api(tags = "点赞接口")
public class LikesController {
    private final LikeService service;

    public LikesController(LikeService service) {
        this.service = service;
    }

    @ApiOperation("动态点赞")
    @PostMapping("likeMoment")
    public R like(@RequestBody LikeMomentDto dto){
        return service.likeMoment(dto);
    }

    @ApiOperation("评论点赞")
    @PostMapping("likeComment")
    public R like(@RequestBody LikeCommentDto dto){
        return service.likeComment(dto);
    }
}
